################
#PSRM: Explaining Support for Redistribution: Social Insurance Systems and Fairness
#
#Observational Data: Eurobarometer
#Figure C 12
#
#Verena Fetscher
#July 2022
####################



####################
# Load data
####################
# EB
load("EB_benefits_17.Rda")



##################
# Fairness Beliefs and Redistribution Preferences
####################


# IMPORTANT FOR GETTING AHEAD IN LIFE - HARD WORK (1 Not important at all - 5 Essential)

##########################
# Figure C.12: Benefit concentration and beliefs in the importance of working hard.
##########################


df_merge%>%
  filter(incgroup==3)%>%
  ggplot(aes(x = rr, y = imp_workhard,label=cntry)) +
  stat_summary(fun.data = mean_se,aes(color="rich"),alpha=.5)+
  geom_smooth(method=lm,se=F,color="grey20",na.rm=T,size=.5)+
  xlab("Benefit concentration")+ ylab("Importance hard work")+
  coord_cartesian(ylim=c(3.5, 4.5), xlim=c(0,.9))+
  stat_summary(aes(label=cntry), fun="mean", geom="text", 
               hjust=0.5, vjust=-.8,size=6)+
  scale_colour_manual(name="Income group", 
                      values=c("grey20"),
                      breaks = c("rich"),
                      labels = c("rich")
  )+
  scale_x_continuous(expand = c(0, 0)) + 
  scale_y_continuous(expand = c(0, 0)) +
  theme_bw()+
  theme(panel.border=element_blank(),axis.line=element_line(),
        legend.position="none",legend.text = element_text(size = 18),
        legend.title = element_text(size=18),axis.text=element_text(size=18),
        axis.title=element_text(size=22)
  )



ggsave(file="figure_c12.pdf", height = 5.83, width = 8.27, units = "in")
